/**
 * Author: w景洋.
 * Time: 2016/9/5 0005
 */
var mall = angular.module('mall', [
    'ui.router',
    'service.auth',
    'service.goods',
    'service.order',
    'service.payment',
    'service.shop',
    'service.shopcart',
    'service.shopmenu',
    'service.tags',
    'service.filter',
    'mall.shopcart.base',
    'mall.shopcart.impl',
    'mall.template',
    'mall.detail',
    'mall.menu',
    'mall.goods.base',
    'mall.goods.impl',
    'mall.order',
    'mall.payment',
    'mall.directive',
]);

mall.run(
    ['$rootScope', '$state', '$stateParams',
        function ($rootScope, $state, $stateParams) {
            $rootScope.$state = $state;
            $rootScope.$stateParams = $stateParams;
        }
    ]
)

mall.config(
    ['$stateProvider', '$urlRouterProvider', '$locationProvider',
        function ($stateProvider, $urlRouterProvider, $locationProvider) {
            $urlRouterProvider
                .when('/detail/:id/:tag', '/detail/:id')
                .when('/menu/:shopid/:tag', '/menu/:shopid')
                .when('/shop/:id/:cid', '/shop/:id')
                .when('/cmtshop/placeorder/:id', '/cmtshop/placeorder')
                .otherwise('/s?county=330329');
            // use the HTML5 History API
            $locationProvider.html5Mode(html5mode);
        }
    ]
)
;